<%@ page import="com.luinnx.message.*"%>
<%@ page import="com.luinnx.message.model.*"%>
<%@ page import="com.luinnx.message.DB.*"%>
<%@ page import="java.util.*"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>My JSP 'main.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!-- <link rel="stylesheet" type="text/css"
href="styles.css"> -->
	</head>
	<body>
		<form action="Leavemessage.jsp" method="post">
			<table border="1">
				<caption>
					所有留言信息
				</caption>
				<tr bordercolor="#ccc">
					<td>
						留言人姓名
					</td>
					<td>
						留言时间
					</td>
					<td>
						留言标题
					</td>
					<td>
						留言类型
					</td>
					<td>
						留言内容
					</td>
					<td>
						更新
					</td>
					<td>
						删除
					</td>
				</tr>
				<!-- 从数据库中查询记录显示于此 -->

				<%
					ArrayList<Leavemessage> al = (ArrayList<Leavemessage>) session
							.getAttribute("al");
					Iterator<Leavemessage> iter = al.iterator();
					while (iter.hasNext()) {
						Leavemessage ly = (Leavemessage) iter.next();
				%>
				<tr>
					<td><%=new DB().getUserName(ly.getUserId())%></td>
					<td><%=ly.getDate().toString()%></td>
					<td><%=ly.getTitle()%></td>
					<td><%=ly.getType()%></td>
					<td><%=ly.getContent()%></td>
					<%-- <td><%=ly.getContentgetup()%></td>
					<td><%=ly.getContentdelete()%></td> --%>
				</tr>
				<%
					}
				%>
			</table>
			<input type="submit" value="留言">
		</form>
	</body>
</html>
